module.exports = (sequelize, Sequelize) => {
	const accounts = sequelize.define(
		'user_info',
		{
			userId: { type: Sequelize.STRING(20), primaryKey: true },
			userName: { type: Sequelize.STRING(10), allowNull: false },
			userAttribute: { type: Sequelize.CHAR(1), allowNull: false },
			userPassword: { type: Sequelize.STRING(20), allowNull: false },
			userPhone: { type: Sequelize.STRING(11), allowNull: false },
			userPlace: { type: Sequelize.STRING(50), allowNull: false },
			userIdentity: { type: Sequelize.STRING(18), allowNull: false },
			userSex: {
				type: Sequelize.CHAR(1),
				allowNull: false,
				defaultValue: '0',
			},
			userAge: { type: Sequelize.TINYINT(3) },
			userEmail: { type: Sequelize.STRING(50) },
			userBirthday: { type: Sequelize.STRING(15) },
		},
		{
			// 禁止 updatedAt, createdAt 自增
			timestamps: false,
			// 自定义标明
			freezeTableName: true,
		}
	)

	return accounts
}
